<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\modules\Order\models\OrderCustomer;
?>

<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	<h4 class="modal-title">人员详情</h4>
</div>

<div class="">
	<table class="table table-hover">
	<tr>
		<th class="col-md-5">状态</th> <th>订单</th><th>人员</th>
	</tr>
	

		<?php 
			foreach($model->orderPrice as $key=>$val){ ?>
			<tr>
				<td class="col-md-3"><?=\yii::$app->params['order_status'][$val->order->status]?></td>
				<td>
					<p><font>销售</font> <?= isset($val->order->member->id) ? $val->order->member->profile->name : '(未设置)'  ?> </p>
					<p><font>订单号</font> <?= $val->order->code ?>
				</td>
				<td>
					<?php 
						if(isset($val->customers)){ 
						   $customers = json_decode($val->customers,true);
						   foreach($customers as $cid){    
						   	 	 $customer = OrderCustomer::findOne($cid);	
						   	 	 if($customer->status == 1){ 
						   	 	 	echo $customer->first_name.$customer->last_name.' / ';?>	
					<?php } } }?>
					
				</td>
			</tr>
		<?php } ?>
	
	</table>
</div>

